// CDlgMain.cpp : implementation file
//

#include "stdafx.h"

#include "DlgMain.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgMain dialog


CDlgMain::CDlgMain(T_TAG_IOLINKER* pTagLink,CWnd* pParent/*=NULL*/)
	: CDialog(CDlgMain::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgMain)
	//}}AFX_DATA_INIT
	m_pTagLink = pTagLink;
}

void CDlgMain::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgMain)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgMain, CDialog)
	//{{AFX_MSG_MAP(CDlgMain)

	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CDlgMain::OnInitDialog() 
{
	CDialog::OnInitDialog();
	GetClientRect(&m_bnFrame);
	if(m_pTagLink->csData[0].length() == 0)
		GetDlgItem(IDC_EDIT1)->SetWindowText("");
	else
		GetDlgItem(IDC_EDIT1)->SetWindowText(m_pTagLink->csData[0].c_str());
	return TRUE;  	              
}

int  CDlgMain::GetCnfg()
{
	CString csData;

	GetDlgItem(IDC_EDIT1)->GetWindowText(csData);
	m_pTagLink->csData[0] = csData.GetBuffer(0);

	return IO_RESULT_OK;
}